package com.angel.architecture.services.impl;

import java.util.ArrayList;
import java.util.List;

import com.angel.architecture.flex.spring.commands.SpringMultipleServiceCommand;
import com.angel.architecture.persistence.base.PersistentObject;
import com.angel.architecture.services.MultipleService;

/**
 *
 * @author William
 */
public class MultipleServiceImpl extends GenericServiceImpl implements MultipleService{

    public List<Object> execute(List<SpringMultipleServiceCommand> multiplesServicesCommands) {
        List<Object> resultados = new ArrayList<Object>();
        for (SpringMultipleServiceCommand multiplesServicesCommand : multiplesServicesCommands) {
            resultados.add(multiplesServicesCommand.execute());
        }
        return resultados;
    }

    @Override
    public PersistentObject create(PersistentObject persistentObject){
        return persistentObject;
    }

    @Override
    public PersistentObject update(Object persistentObject){
        return (PersistentObject) persistentObject;
    }

    @Override
    public void remove(Object persistentObject){ }
}
